$(function(){

  $.post(base_url+'home/ajaxVerificaUsuarioRegistroCompleto', {}, function(result) {

      if (result == 0) {
        show_perfil();
      }else if(result == 2){
        show_cangearegalo();
      }
  });

});


function show_perfil(){
  $("#sb").remove();
  sbox = '<a href="'+base_url+'home/registro_flotante" rel="superbox[iframe][320x412]" id="sb"></a>'; // 330x422
  $(sbox).appendTo("body");

  $.superbox.settings = {
    boxId: "superbox", // Id attribute of the "superbox" element
    boxClasses: "", // Class of the "superbox" element
    overlayOpacity: .9, // Background opaqueness
    boxWidth: "600", // Default width of the box
    boxHeight: "400", // Default height of the box
    loadTxt: "Loading...", // Loading text
    closeTxt: "Close", // "Close" button text
    prevTxt: "Previous", // "Previous" button text
    nextTxt: "Next", // "Next" button text
    closeOnClick: true,
    closeEsc: true
  };

  $.superbox();
  $('#superbox .close').css({
    'display': 'none'
  });

  $('#sb').click();
}

function show_cangearegalo(){
  $("#sb").remove();
  sbox = '<a href="'+base_url+'home/cangea_regalo" rel="superbox[iframe][400x200]" id="sb"></a>'; // 330x422
  $(sbox).appendTo("body");

  $.superbox.settings = {
    boxId: "superbox", // Id attribute of the "superbox" element
    overlayOpacity: .9, // Background opaqueness
    closeOnClick: true,
    closeEsc: true
  };

  $.superbox();
  $('#superbox .close').css({
    'display': 'none'
  });

  $('#sb').click();
}